<template>
	<div class="imgList" :style="{height:(this.imgList.imageHeight/2)+4+'px'}">
		<img v-if="type==0" class="img" ref="img" v-lazy="imgList.img_url" alt="" >
		<div class="imgItem" v-if="type==0" v-for="(item,index) of imgList.protocolList" @click="titleUrl(item.jump_url)" :key="index"></div>
		<div class="imgItem" v-if="type==1" v-for="(item,index) of imgList.data" @click="titleUrl(item.jump_url || item.h5_url)" :key="index">
			<img v-lazy="item.img_url" alt="">
		</div>
	</div>
</template>
<script>
export default{
	name:'imgList',
	data(){
		return{
			imgListH:{
				height:0
			},
			showItem:false
		}
	},
	props:{
		imgList:Object,
		type:Number
	},
	mounted(){
		//let imgH=this.$refs.img.offsetHeight
		//this.imgListH.height=imgH+'px'
	},
	methods:{
		titleUrl(h5_url){
			if(!h5_url){
				return
			}
			window.location.href=h5_url
		}
	},
	watch:{

	}
}
</script>
<style lang="stylus" scoped>
.imgList{width:100%;overflow:hidden;display: flex;flex-direction: row;align-items: center;background:#fff;position:relative;}
.img{width:100%;position:absolute;left:0;top:0;z-index:1;}
.imgItem{flex:1;position:relative;z-index:2;height:100%;}
.imgItem img{width:100%;}
</style>